﻿Namespace SRAGWM

    Public Class WebMapHelper

        Shared Function DisplayFeature(ByRef objms As MAPSRVLib.GWMMapServerHelper, _
                                ByRef Le As SRAGWMLegendEntry, ByVal Tooltip As String)

            Dim ObjMkr As MAPSRVLib.GWMMarkerSystem
            Dim objDisplayRule As MAPSRVLib.GWMDisplayRule
            Dim objSym As MAPSRVCOMPONENTSLib.GWMFeatureSymbology

            'DataSource
            ObjMkr = objms.AddMarker(Le.DataSource.DBName, Le.DataSource.DB, Le.DataSource.Table, "", Le.DataSource.Atributes)

            'Filter
            ObjMkr.AddElementsByPolygon(Le.Filter.WhereClause, Le.Filter.Points, Le.Filter.NumPairs, Le.Filter.SpatialOperator)

            'Legend
            objDisplayRule = ObjMkr.NewDisplayRule
            objSym = objms.CreateObject("GMWebMap.GWMFeatureSymbology")
            objSym.Color = RGB(Le.BorderColor.R, Le.BorderColor.G, Le.BorderColor.B)
            objSym.Weight = Le.SymbologyWeight
            objSym.Style = Le.SymbologyStyle
            objSym.FillColor = RGB(Le.FillColor.R, Le.FillColor.G, Le.FillColor.B)
            objDisplayRule.DisplaySymbology = objSym
            objDisplayRule.Tooltip = Le.Tooltip
            'rng
            Return ObjMkr.Range

        End Function

    End Class

End Namespace
